﻿@page "/"
@namespace HC.XAP.FileUpload.Blazor.Server
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using DevExpress.ExpressApp.Blazor.Components

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- meta name="theme-color" content="#000000" -->
    <title>HC.XAP.FileUpload</title>
    <base href="~/" />
    <component type="typeof(BootstrapThemeLink)" render-mode="Static" />
</head>
<body>
    @{
        string userAgent = Request.Headers["User-Agent"];
        bool isIE = userAgent.Contains("MSIE") || userAgent.Contains("Trident");
    }
    @if(isIE) {
        <link href="css/site.css" rel="stylesheet" />
        <div class="d-flex flex-column justify-content-center align-items-center h-100">
            <div class="d-flex">
                <img class="mt-2 mr-4" src="_content/DevExpress.ExpressApp.Blazor/images/Sad.svg" width="60" height="60" />
                <div>
                    <div class="h1">Internet Explorer is not supported.</div>
                    <p style="font-size: 1rem; opacity: 0.75;" class="m-0">HC.XAP.FileUpload cannot be loaded in Internet Explorer.<br>Please use a different browser.</p>
                </div>
            </div>
        </div>
    }
    else {
        <component type="typeof(SplashScreen)" render-mode="Static" param-Caption='"HC.XAP.FileUpload"' param-ImagePath='"images/SplashScreen.svg"' />

        <link href="_content/DevExpress.ExpressApp.Blazor/styles.css" rel="stylesheet" asp-append-version="true" />
        <link href="css/site.css" rel="stylesheet" />
        // Uncomment this link to enable CSS isolation. For more information, refer to the following topic: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation
        //<link href="HC.XAP.FileUpload.Blazor.Server.styles.css" rel="stylesheet">

        <app class="d-none">
            <component type="typeof(App)" render-mode="Server" />
        </app>
        
        <component type="typeof(AlertsHandler)" render-mode="Server" />

        <div id="blazor-error-ui">
            <component type="typeof(BlazorError)" render-mode="Static" />
        </div>

        <script src="_framework/blazor.server.js"></script>

       @*  <script>
            window.downloadFileFromStream = async (fileName, contentStreamReference) => {
                const arrayBuffer = await contentStreamReference.arrayBuffer();
                const blob = new Blob([arrayBuffer]);
                const url = URL.createObjectURL(blob);
                const anchorElement = document.createElement('a');
                anchorElement.href = url;
                anchorElement.download = encodeURIComponent(fileName) ?? '';
                anchorElement.click();
                anchorElement.remove();
                URL.revokeObjectURL(url);
            }
        </script> *@

    }
</body>
</html>
